package learningThread.syn.synchronizedMethodLockObj.lockReentrant;

/**
 * syn锁重入
 */
public class TestReetrant {

    public static void main(String[] args) {
        Service service = new Service();
        Thread thread = new Thread() {
            @Override
            public void run() {
                service.service1();
            }
        };
        thread.start();

        Service subService = new SubService();
        Thread thread1 = new Thread() {
            @Override
            public void run() {
                ((SubService) subService).subService();
            }
        };
        thread1.start();
    }
}
